#ifndef DYN_TARGET_ITEM_PRIVATE_H
#define DYN_TARGET_ITEM_PRIVATE_H
#include <osgEarthAnnotation/GeoPositionNode.h>
#include "DynamicEntity.h"
#include "DynTargetItemSetPrivate.h"
#include "PropertySetPrivate.h"
#include "dynamic/DynamicEntityPrivate.h"

class DynTargetItemPrivate : public DynTargetItem
{
public:
	DynTargetItemPrivate() = delete;
	DynTargetItemPrivate(const QString& name,const QString& group,const QString& nation,const QString& type,DynTargetItemSetPrivate* set);
	~DynTargetItemPrivate();
public:
	SET_PROPERTY_BLOCK
	SET_DYNAMIC_ENTITY_BLOCK

	double getDefaultScale()const { return 1.0f; }

	void dirty();

	void setVisible(bool visible);
	bool isVisible()const;

	DynTargetItemTrack* track() const;

    bool isAirplane() const;
    bool isShip() const;

    QString getNation() const;
    QString getGroupName() const;
	QString getItemType()const;

	bool appendTrack(double lon,double lat,double alt,quint64 time,double head = 0.0);

	void setColor(const QString& color);
	void setTrackColor(const QString& color);

    bool isContains(double x,double y);

    DynTargetItemSet* getDynTargetSet() const;
    HistoryTrackLine* getHistoryTrackLine()const;
private:
	DynTargetItemSetPrivate* itemSet = nullptr;

	bool ship,plane;
	QString targetGroup,targetNation,targetType;
	QString targetColor = "blue";
	QString trackColor = "green";

	osgEarth::Annotation::GeoPositionNode* positionNode = nullptr;
};

#endif
